<template>
  <div class="goods" @click="goodsDetail" :style="styleData" :data-id="item.goods_id">
    <div class="picture"><img v-lazy="{src:item.img640_url,loading:lazyPic}" alt=""></div>
    <!-- <div class="title">{{item.goods_name}}</div>
    <div class="price">
      <span class="curr"><i>￥</i><em>{{item.flash_price}}</em></span>
      <span class="prev"><i>￥</i><del>{{item.shop_price}}</del></span>
    </div>
    <div class="btn">立即购买 &gt;</div> -->
  </div>
  <!-- <div data-v-18e33bca="" data-v-204a54ba="" class="goods self"><div data-v-18e33bca="" class="picture"><img data-v-18e33bca="" alt="" data-src="http://img.shandjj.com/fdc/20190529/img/46da08a82daf6160a3f75af8e3f2990b_640_640.jpg" src="http://img.shandjj.com/fdc/20190529/img/46da08a82daf6160a3f75af8e3f2990b_640_640.jpg" lazy="loaded"></div></div> -->
</template>
<script>
  export default {
    props:['parentData','styleData'],
    data(){
      return{item:{},lazyPic:require('../../assets/img/publicImg/loading_default.png') }
    },
    created(){
      this.item=this.parentData;
    },
    methods:{
      goodsDetail(){this.$emit('childEvent',this.item.goods_id)}
    }
  }
</script>

<style lang="less" scoped>
.goods.self{
  width: 2.25rem;
  padding: 0rem !important;
  margin-right: 0.12rem;
  margin-bottom: 0rem !important;
  background: #fff;
  box-sizing: border-box;
  position: relative;
  &:nth-child(2n){margin-right: 0;}
  .picture{
    width: 100%;
    padding-top: 100%;
    position: relative;
    img{
      width: 100%;height: 100%;
      position: absolute;
      top: 0;left: 0;
    }
  }
  .title{
    height: 0.35rem;
    line-height: 0.35rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .price{
    line-height: 0.36rem;
    padding-top: 0.12rem;
    font-size: 0.32rem;
    color: #D21D3D;
    i,em,del{font-style: normal;}
    .curr{font-weight: 600;i{font-size: 0.26rem;}}
    .prev{color: #999999;font-size: 0.24rem;}
  }
  .btn{
    width: 1rem;height: 0.28rem;
    color: #fff;
    border-radius: 0.06rem;
    line-height: 0.28rem;
    font-size: 0.16rem;
    text-align: center;
    position: absolute;
    bottom: 0.15rem;right: 0.15rem;
    background: #D21D3D;
  }
}
</style>